#ifndef _CONFIG_H_
#define _CONFIG_H_

#include <string>
#include <map>

namespace AYOO{

class Config
{
public:
	Config();
	Config(const Config& other)
	{
		this->_map = other._map;
	}
	virtual ~Config();
	Config &operator = (const Config &other) 
	{
		this->_map = other._map;
		return *this;
	}

	void Clear();
	std::string Trim(std::string &str);
	int Read(const std::string &conf_file);
	std::string GetStr(const std::string &sName) const;
	int GetInt(const std::string &sName) const;

protected:
	std::map<std::string, std::string> _map;
};

class GlobalConfig : public Config
{
public:
    static GlobalConfig &GetInstance()
    {
    	static GlobalConfig _instance;
        return _instance;
    }
private:
    GlobalConfig(){}
    ~GlobalConfig(){}
};

}; /*namespace:AYOO*/

#endif  /*_CONFIG_H_*/

